import React from "react";
import PropTypes from "prop-types";
import classes from "./index.module.css";

export default class PriceTag extends React.PureComponent {
    static propTypes = {
        currency: PropTypes.string,
        price: PropTypes.string.isRequired,
        unit: PropTypes.string,
        color: PropTypes.string,
        pre:PropTypes.string,
        unitWithBar:PropTypes.any
    };

    static defaultProps = {
        color: "#FF7600"
    };

    constructor(props) {
        super(props);
    }

    render() {
        return (
            <span className={classes.Wrapper} style={{color: this.props.color}}>
                <span>{this.props.pre}</span>
                <span>{this.props.currency}</span>
                <span className={classes.PriceText}>{this.props.price}{this.props.unit && "/"}</span>
                <span>{this.props.unit}</span>
                <span>{this.props.unitWithBar}</span>
            </span>
        );
    }
}